﻿/*
 * XCoder v3.4.2011.0316
 * 作者：nnhy/X
 * 时间：2011-04-04 11:42:50
 * 版权：版权所有 (C) 新生命开发团队 2010
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace NXCMS.Sys
{
	/// <summary>
	/// 列值
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("列值")]
	[BindTable("ColumnValue", Description = "列值", ConnName = "Sys", DbType = DatabaseType.SqlServer)]
	public partial class ColumnValue
	{
		#region 属性
		private Int32 _ID;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ID", "编号", "", "int", 10, 0, false)]
		public Int32 ID
		{
			get { return _ID; }
			set { if (OnPropertyChange("ID", value)) _ID = value; }
		}

		private Int32 _ColumnID;
		/// <summary>
		/// 列编号
		/// </summary>
		[Description("列编号")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(2, "ColumnID", "列编号", "", "int", 10, 0, false)]
		public Int32 ColumnID
		{
			get { return _ColumnID; }
			set { if (OnPropertyChange("ColumnID", value)) _ColumnID = value; }
		}

		private String _ColumnCode;
		/// <summary>
		/// 列代码
		/// </summary>
		[Description("列代码")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(3, "ColumnCode", "列代码", "", "nvarchar(100)", 0, 0, true)]
		public String ColumnCode
		{
			get { return _ColumnCode; }
			set { if (OnPropertyChange("ColumnCode", value)) _ColumnCode = value; }
		}

		private String _TextValue;
		/// <summary>
		/// 文本值
		/// </summary>
		[Description("文本值")]
		[DataObjectField(false, false, true, 1073741823)]
		[BindColumn(4, "TextValue", "文本值", "", "ntext", 0, 0, true)]
		public String TextValue
		{
			get { return _TextValue; }
			set { if (OnPropertyChange("TextValue", value)) _TextValue = value; }
		}

		private Boolean _RelaType;
		/// <summary>
		/// 关系类型
		/// </summary>
		[Description("关系类型")]
		[DataObjectField(false, false, true, 1)]
		[BindColumn(5, "RelaType", "关系类型", "", "bit", 0, 0, false)]
		public Boolean RelaType
		{
			get { return _RelaType; }
			set { if (OnPropertyChange("RelaType", value)) _RelaType = value; }
		}

		private String _RelaID;
		/// <summary>
		/// 关系编号
		/// </summary>
		[Description("关系编号")]
		[DataObjectField(false, false, true, 100)]
		[BindColumn(6, "RelaID", "关系编号", "", "nvarchar(100)", 0, 0, true)]
		public String RelaID
		{
			get { return _RelaID; }
			set { if (OnPropertyChange("RelaID", value)) _RelaID = value; }
		}

		private String _BackupNo;
		/// <summary>
		/// 备份编号
		/// </summary>
		[Description("备份编号")]
		[DataObjectField(false, false, true, 15)]
		[BindColumn(7, "BackupNo", "备份编号", "", "nvarchar(15)", 0, 0, true)]
		public String BackupNo
		{
			get { return _BackupNo; }
			set { if (OnPropertyChange("BackupNo", value)) _BackupNo = value; }
		}

		private String _BackupOperator;
		/// <summary>
		/// 备份操作者
		/// </summary>
		[Description("备份操作者")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(8, "BackupOperator", "备份操作者", "", "nvarchar(200)", 0, 0, true)]
		public String BackupOperator
		{
			get { return _BackupOperator; }
			set { if (OnPropertyChange("BackupOperator", value)) _BackupOperator = value; }
		}

		private DateTime _BackupTime;
		/// <summary>
		/// 备份时间
		/// </summary>
		[Description("备份时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(9, "BackupTime", "备份时间", "", "datetime2", 7, 0, false)]
		public DateTime BackupTime
		{
			get { return _BackupTime; }
			set { if (OnPropertyChange("BackupTime", value)) _BackupTime = value; }
		}

		private String _BackupMemo;
		/// <summary>
		/// 备份注释
		/// </summary>
		[Description("备份注释")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(10, "BackupMemo", "备份注释", "", "nvarchar(50)", 0, 0, true)]
		public String BackupMemo
		{
			get { return _BackupMemo; }
			set { if (OnPropertyChange("BackupMemo", value)) _BackupMemo = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "ID" : return _ID;
					case "ColumnID" : return _ColumnID;
					case "ColumnCode" : return _ColumnCode;
					case "TextValue" : return _TextValue;
					case "RelaType" : return _RelaType;
					case "RelaID" : return _RelaID;
					case "BackupNo" : return _BackupNo;
					case "BackupOperator" : return _BackupOperator;
					case "BackupTime" : return _BackupTime;
					case "BackupMemo" : return _BackupMemo;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "ID" : _ID = Convert.ToInt32(value); break;
					case "ColumnID" : _ColumnID = Convert.ToInt32(value); break;
					case "ColumnCode" : _ColumnCode = Convert.ToString(value); break;
					case "TextValue" : _TextValue = Convert.ToString(value); break;
					case "RelaType" : _RelaType = Convert.ToBoolean(value); break;
					case "RelaID" : _RelaID = Convert.ToString(value); break;
					case "BackupNo" : _BackupNo = Convert.ToString(value); break;
					case "BackupOperator" : _BackupOperator = Convert.ToString(value); break;
					case "BackupTime" : _BackupTime = Convert.ToDateTime(value); break;
					case "BackupMemo" : _BackupMemo = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得列值字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 编号
			///</summary>
			public const String ID = "ID";

			///<summary>
			/// 列编号
			///</summary>
			public const String ColumnID = "ColumnID";

			///<summary>
			/// 列代码
			///</summary>
			public const String ColumnCode = "ColumnCode";

			///<summary>
			/// 文本值
			///</summary>
			public const String TextValue = "TextValue";

			///<summary>
			/// 关系类型
			///</summary>
			public const String RelaType = "RelaType";

			///<summary>
			/// 关系编号
			///</summary>
			public const String RelaID = "RelaID";

			///<summary>
			/// 备份编号
			///</summary>
			public const String BackupNo = "BackupNo";

			///<summary>
			/// 备份操作者
			///</summary>
			public const String BackupOperator = "BackupOperator";

			///<summary>
			/// 备份时间
			///</summary>
			public const String BackupTime = "BackupTime";

			///<summary>
			/// 备份注释
			///</summary>
			public const String BackupMemo = "BackupMemo";
		}
		#endregion
	}
}